package com.wl.login;

import com.wl.login.bean.LoginProperties;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@AutoConfiguration
@ComponentScan("com.wl.login")
@ConditionalOnProperty(prefix = "login",name="enable",matchIfMissing = true)
@EnableConfigurationProperties(LoginProperties.class)
public class LoginConfiguration implements WebMvcConfigurer {

//    @Autowired
//    LoginInterceptor loginInterceptor;
//    @Autowired
//    LoginProperties properties;
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        if (properties.getLoginScope()!=null&&properties.getLoginScope().length>0) {
//            registry.addInterceptor(loginInterceptor)
//                    .addPathPatterns(properties.getLoginScope());
//        }
//    }
}
